﻿using BlankAbp.Application.Contracts;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Http.Client;
using Volo.Abp.Modularity;
using Volo.Abp.VirtualFileSystem;

namespace BlankAbp.HttpApi.Client
{
    [DependsOn(
        typeof(AbpHttpClientModule),
        typeof(ApplicationContractsModule)
    )]
    public class HttpApiClientModule : AbpModule
    {
        public const string RemoteServiceName = "Default";

        public override void ConfigureServices(ServiceConfigurationContext context)
        {
            context.Services.AddHttpClientProxies(
                typeof(ApplicationContractsModule).Assembly,
                RemoteServiceName
            );

            Configure<AbpVirtualFileSystemOptions>(options => {
                options.FileSets.AddEmbedded<HttpApiClientModule>();
            });
        }
    }
}
